<template>
  <div id="app">
    <header class="head">
      <a class="back tl" href="javascript:history.back(-1)">
        <i class="el-icon-arrow-left"></i>
      </a>
      <a href="javascript:;" class="tc">
        <small class="font_18 co_f">出货记录</small>
      </a>
      <a class="operation" v-on:click="show = !show">
        <i class="el-icon-setting"></i> 操作
      </a>
  
      <!--dialog-->
      <transition name="fade">
        <div class="operatbox" v-show="show">
          <router-link :to='{name:"Chjllistupdate",query:{
             unid:this.itemunid
            }}'>修改</router-link>
          <a @click="handleDelete()">删除</a>
        </div>
      </transition>
    </header>
   
    <main>
      <div class="formcontent">
        <ul>
          <li>
            <span>原料类型</span>
            <div class="froms">
              <el-radio-group v-model="typeradio">
                <el-radio :label="0" disabled>散装加工原料</el-radio>
                <el-radio :label="1" disabled>预包装原料</el-radio>
              </el-radio-group>
            </div>
          </li>
            <li>
            <span> 进货日期</span>
            <div class="froms">
              <label>{{listData.stockDate|time}}</label>
            </div>
          </li>
           <li>
            <span>原料名称</span>
            <div class="froms">
              <label>{{listData.demandWarehouse.name}}</label>
  
            </div>
          </li>
          <li>
            <span>原料类别</span>
            <div class="froms">
              <label>{{this.listData.demandWarehouse.demandType.name}}</label>
  
            </div>
          </li>
            <li>
            <span>生产商</span>
            <div class="froms">
              <label>{{listData.demandWarehouse.producers}}</label>
            </div>
          </li>
          <li>
            <span>品牌</span>
            <div class="froms">
              <label>{{listData.demandWarehouse.brand}}</label>
            </div>
          </li>

          <li>
            <span>规格含净量</span>
            <div class="froms">
              <label>{{listData.demandWarehouse.norms}}</label>
            </div>
          </li>
          <li>
            <span>生产日期</span>
            <div class="froms">
              <label>{{listData.productionDate|time}}</label>
            </div>
          </li>
          <li>
            <span>有效日期</span>
            <div class="froms">
              <label>{{listData.deadlineDate|time}}</label>
            </div>
          </li>
    
          <li>
            <span>进库数</span>
            <div class="froms">
              <label>{{listData.num}}</label>
              </div>
          </li>
          <li>
            <span>验收人</span>
            <div class="froms">
              <label>{{listData.enterprisePerson.name}}</label>
            </div>
          </li>
          <li>
            <span>记录时间</span>
            <div class="froms">
              <label>{{listData.recordDate|time}}</label>
            </div>
          </li>
        </ul>
        <p style="background: #eef1f6;padding: 10px;font-size: 1rem;">
          供应商信息
        </p>
         <ul>
          <li>
            <span>供应商</span>
            <div class="froms">
               <label>{{this.listData.supplier.name}}</label>
            </div>
          </li>
           <li>
            <span>供应商</span>
            <div class="froms">
               <label>{{this.listData.supplier.address}}</label>
            </div>
          </li>
           <li>
            <span>营业执照号</span>
            <div class="froms">
               <label>{{this.listData.supplier.code}}</label>
            </div>
          </li>
           <li>
            <span>食品流通号</span>
            <div class="froms">
               <label>{{this.listData.supplier.foodCirculationCode}}</label>
            </div>
          </li>
           <li>
            <span>联系人</span>
            <div class="froms">
               <label>{{this.listData.supplier.contactPerson}}</label>
            </div>
          </li>
           <li>
            <span>联系电话</span>
            <div class="froms">
               <label>{{this.listData.supplier.contactPhone}}</label>
            </div>
          </li>
           <li>
            <span>负责人</span>
            <div class="froms">
               <label>{{this.listData.supplier.chargePerson}}</label>
            </div>
          </li>
           <li>
            <span>主体类型</span>
            <div class="froms">
               <label>{{this.listData.supplier.bodyType}}</label>
            </div>
          </li>
           <li>
            <span>许可证范围:</span>
            <div class="froms">
               <label>{{this.listData.supplier.licenseScope}}</label>
            </div>
          </li>
           <li>
            <span>发证机关:</span>
            <div class="froms">
               <label>{{this.listData.supplier.certificateOrgan}}</label>
            </div>
          </li>
            <li>
            <span>有效日期:</span>
            <div class="froms">
               <label>{{this.listData.supplier.startDate|time}}</label>
            </div>
          </li>
            <li>
            <span>截止日期:</span>
            <div class="froms">
               <label>{{this.listData.supplier.endDate|time}}</label>
            </div>
          </li>
         </ul>
      </div>
    </main>
  </div>
</template>

<script>
  import {
    DemandCertificateDelete,
  } from '../../api/api';
  export default {
    data() {
      return {
        listData: {},
        typeradio:'',
        itemunid: this.$route.query.unid,
        show: false, //默认隐藏
      };
    },
    methods: {
        handleDelete() {
        let deletParams = {
          params: {
            unids: this.$route.query.unid,
          }
        }
        this.$confirm('是否删除此条信息?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          DemandCertificateDelete(deletParams).then(() => {
            this.$router.go(-1);
          });
        });
      },
    },
    created() {
      this.listData = JSON.parse(sessionStorage.getItem('Chjllistdetail')).content
      this.typeradio=this.listData.type
    },
  }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->

<style lang="scss" scoped>
  
</style>
